package net.sareweb.acab.entity;

// Generated 13-abr-2010 15:53:20 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Request generated by hbm2java
 */
@Entity
@Table(name = "request", catalog = "acab")
public class Request implements java.io.Serializable {

	private Integer idRequest;
	private City cityByToCity;
	private State stateByFromState;
	private Country countryByFromCountry;
	private User user;
	private State stateByToState;
	private City cityByFromCity;
	private Country countryByToCountry;
	private String name;
	private float fromLat;
	private float fromLon;
	private float toLat;
	private float toLon;
	private Float distance;
	private Date beginDate;
	private Date endDate;
	private boolean singleDay;
	private Boolean monday;
	private Boolean tuesday;
	private Boolean wednesday;
	private Boolean thursday;
	private Boolean friday;
	private Boolean saturday;
	private Boolean sunday;
	private String cronExpression;
	private Date createDate;
	private Date modifyDate;
	private Date deleteDate;
	private Set<Match> matchs = new HashSet<Match>(0);
	private Set<Suggestion> suggestions = new HashSet<Suggestion>(0);

	public Request() {
	}

	public Request(User user, String name, float fromLat, float fromLon,
			float toLat, float toLon, Date beginDate, boolean singleDay,
			String cronExpression, Date createDate) {
		this.user = user;
		this.name = name;
		this.fromLat = fromLat;
		this.fromLon = fromLon;
		this.toLat = toLat;
		this.toLon = toLon;
		this.beginDate = beginDate;
		this.singleDay = singleDay;
		this.cronExpression = cronExpression;
		this.createDate = createDate;
	}

	public Request(City cityByToCity, State stateByFromState,
			Country countryByFromCountry, User user, State stateByToState,
			City cityByFromCity, Country countryByToCountry, String name,
			float fromLat, float fromLon, float toLat, float toLon,
			Float distance, Date beginDate, Date endDate, boolean singleDay,
			Boolean monday, Boolean tuesday, Boolean wednesday,
			Boolean thursday, Boolean friday, Boolean saturday, Boolean sunday,
			String cronExpression, Date createDate, Date modifyDate,
			Date deleteDate, Set<Match> matchs, Set<Suggestion> suggestions) {
		this.cityByToCity = cityByToCity;
		this.stateByFromState = stateByFromState;
		this.countryByFromCountry = countryByFromCountry;
		this.user = user;
		this.stateByToState = stateByToState;
		this.cityByFromCity = cityByFromCity;
		this.countryByToCountry = countryByToCountry;
		this.name = name;
		this.fromLat = fromLat;
		this.fromLon = fromLon;
		this.toLat = toLat;
		this.toLon = toLon;
		this.distance = distance;
		this.beginDate = beginDate;
		this.endDate = endDate;
		this.singleDay = singleDay;
		this.monday = monday;
		this.tuesday = tuesday;
		this.wednesday = wednesday;
		this.thursday = thursday;
		this.friday = friday;
		this.saturday = saturday;
		this.sunday = sunday;
		this.cronExpression = cronExpression;
		this.createDate = createDate;
		this.modifyDate = modifyDate;
		this.deleteDate = deleteDate;
		this.matchs = matchs;
		this.suggestions = suggestions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idRequest", unique = true, nullable = false)
	public Integer getIdRequest() {
		return this.idRequest;
	}

	public void setIdRequest(Integer idRequest) {
		this.idRequest = idRequest;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "toCity")
	public City getCityByToCity() {
		return this.cityByToCity;
	}

	public void setCityByToCity(City cityByToCity) {
		this.cityByToCity = cityByToCity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fromState")
	public State getStateByFromState() {
		return this.stateByFromState;
	}

	public void setStateByFromState(State stateByFromState) {
		this.stateByFromState = stateByFromState;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fromCountry")
	public Country getCountryByFromCountry() {
		return this.countryByFromCountry;
	}

	public void setCountryByFromCountry(Country countryByFromCountry) {
		this.countryByFromCountry = countryByFromCountry;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user", nullable = false)
	@NotNull
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "toState")
	public State getStateByToState() {
		return this.stateByToState;
	}

	public void setStateByToState(State stateByToState) {
		this.stateByToState = stateByToState;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fromCity")
	public City getCityByFromCity() {
		return this.cityByFromCity;
	}

	public void setCityByFromCity(City cityByFromCity) {
		this.cityByFromCity = cityByFromCity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "toCountry")
	public Country getCountryByToCountry() {
		return this.countryByToCountry;
	}

	public void setCountryByToCountry(Country countryByToCountry) {
		this.countryByToCountry = countryByToCountry;
	}

	@Column(name = "name", nullable = false, length = 100)
	@NotNull
	@Length(max = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "fromLat", nullable = false, precision = 12, scale = 0)
	public float getFromLat() {
		return this.fromLat;
	}

	public void setFromLat(float fromLat) {
		this.fromLat = fromLat;
	}

	@Column(name = "fromLon", nullable = false, precision = 12, scale = 0)
	public float getFromLon() {
		return this.fromLon;
	}

	public void setFromLon(float fromLon) {
		this.fromLon = fromLon;
	}

	@Column(name = "toLat", nullable = false, precision = 12, scale = 0)
	public float getToLat() {
		return this.toLat;
	}

	public void setToLat(float toLat) {
		this.toLat = toLat;
	}

	@Column(name = "toLon", nullable = false, precision = 12, scale = 0)
	public float getToLon() {
		return this.toLon;
	}

	public void setToLon(float toLon) {
		this.toLon = toLon;
	}

	@Column(name = "distance", precision = 12, scale = 0)
	public Float getDistance() {
		return this.distance;
	}

	public void setDistance(Float distance) {
		this.distance = distance;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "beginDate", nullable = false, length = 0)
	@NotNull
	public Date getBeginDate() {
		return this.beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "endDate", length = 0)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Column(name = "singleDay", nullable = false)
	public boolean isSingleDay() {
		return this.singleDay;
	}

	public void setSingleDay(boolean singleDay) {
		this.singleDay = singleDay;
	}

	@Column(name = "monday")
	public Boolean getMonday() {
		return this.monday;
	}

	public void setMonday(Boolean monday) {
		this.monday = monday;
	}

	@Column(name = "tuesday")
	public Boolean getTuesday() {
		return this.tuesday;
	}

	public void setTuesday(Boolean tuesday) {
		this.tuesday = tuesday;
	}

	@Column(name = "wednesday")
	public Boolean getWednesday() {
		return this.wednesday;
	}

	public void setWednesday(Boolean wednesday) {
		this.wednesday = wednesday;
	}

	@Column(name = "thursday")
	public Boolean getThursday() {
		return this.thursday;
	}

	public void setThursday(Boolean thursday) {
		this.thursday = thursday;
	}

	@Column(name = "friday")
	public Boolean getFriday() {
		return this.friday;
	}

	public void setFriday(Boolean friday) {
		this.friday = friday;
	}

	@Column(name = "saturday")
	public Boolean getSaturday() {
		return this.saturday;
	}

	public void setSaturday(Boolean saturday) {
		this.saturday = saturday;
	}

	@Column(name = "sunday")
	public Boolean getSunday() {
		return this.sunday;
	}

	public void setSunday(Boolean sunday) {
		this.sunday = sunday;
	}

	@Column(name = "cronExpression", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getCronExpression() {
		return this.cronExpression;
	}

	public void setCronExpression(String cronExpression) {
		this.cronExpression = cronExpression;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createDate", nullable = false, length = 0)
	@NotNull
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modifyDate", length = 0)
	public Date getModifyDate() {
		return this.modifyDate;
	}

	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "deleteDate", length = 0)
	public Date getDeleteDate() {
		return this.deleteDate;
	}

	public void setDeleteDate(Date deleteDate) {
		this.deleteDate = deleteDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "request")
	public Set<Match> getMatchs() {
		return this.matchs;
	}

	public void setMatchs(Set<Match> matchs) {
		this.matchs = matchs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "request")
	public Set<Suggestion> getSuggestions() {
		return this.suggestions;
	}

	public void setSuggestions(Set<Suggestion> suggestions) {
		this.suggestions = suggestions;
	}

}
